package com.sport.dao;

import com.sport.bean.Admin;
import com.sport.bean.PageParam;
import com.sport.bean.Student;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentDao {
    @Select("select * from student")
    //查找所有学生
    List<Student> findAll();
    //根据学生id查找
    Student findById(Integer id);

    //根据学生名字查找
    Student findByName(String stuname);

    //根据学号查找是否相同
    Student findByStuno(String stuno);
    //更新学生
    int updateStu(@Param("student")Student student);
    //添加学生
    int addStudent(Student student);
    //删除学生
    @Delete("DELETE FROM `student` WHERE `id` = #{id}")
    int deletStudent(Integer id);
    List<Student> listStudent();
    //分页
    List<Student> listPage(@Param("page")PageParam<Student> page);
}
